<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<script language="javascript">

$(document).ready(function() {
    
   // Seteamos el limite
   $('#hipermedio_nombre').keyup(function(){
            limitChars('hipermedio_nombre', 140, 'charlimitinfo');
    })
})

</script>

<form action="<?php echo url_for('hipermedio/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
    <fieldset>
        <legend> <div class="circle">1</div> Coloca el título del hipermedio</legend>
        <?php if (!$form->getObject()->isNew()): ?>
        <input type="hidden" name="sf_method" value="put" />
        <?php endif; ?>

        <div align="center">
            <table>
                <tfoot>
                  <tr>
                      <td colspan="2">
                          <span id="charlimitinfo" style="float:right;">Escribe tu título de 140 caracteres.</span> 
                      </td>
                  </tr>
                  <tr>
                    <td colspan="2">
                      <?php if (!$form->getObject()->isNew()): ?>
                        &nbsp;<?php echo link_to('Delete', 'hipermedio/delete?id='.$form->getObject()->getId(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?>
                      <?php endif; ?>
                      <input type="submit" value="Siguiente" />
                    </td>
                  </tr>
                </tfoot>
                <tbody>
                  <?php echo $form ?>
                </tbody>
             </table> 
        </div>    
    </fieldset>
</form>
